define([ "PDAppDir/properties", 
		"PDUtilDir/slidebar", "PDUtilDir/grid",
		"css!AppPathDir/order/orderInfos/views/css/css" ], function(Properties,
		Slidebar, Grid) {
	function rebackRecodeSupportInit($scope, $compile) {
		return new rebackRecodeSupport($scope, $compile);
	}
	function rebackRecodeSupport($scope, $compile) {
		this.$scope = $scope;
		this.$compile = $compile;
	}
	rebackRecodeSupport.fn = rebackRecodeSupport.prototype;
	rebackRecodeSupport.fn.digest = function() {
		this.$scope.$digest();
	}
	rebackRecodeSupport.fn.run = function(data) {
		var _this = this;
        _this.entity = {
            orderNo: data
        };
		
		this.slidebars = Slidebar({
			size : 'lg',
			url : getServer() + "/static/app/order/orderDoneInfos/views/rebackRecode.html",
//			close : true,
			$scope : this.$scope,
			$compile : this.$compile,
			afterLoad : function($Panel) {
				_this.initialization();
			}
		});
	};
	rebackRecodeSupport.fn.initialization = function() {
		var _this = this;
		Grid({
			id : "OrderRebackRecodeGirdDivId",
			pageSize : 10,
			index : true,
			multi : true,
			pagination : true,
			cache : false,
			layout : [ {
				name : "订单号",
				field : "orderNo",
				sort : false
			}, {
                name : "支付方式",
                field : "platformType",
                format : function(e) {
                    return _this.$scope.cache.typeMap.get(e.row.platformType);
                }
            }, {
                name : "支付金额",
                field : "rebackPayment",
                sort : false
            }, {
                name : "流水号",
                field : "serialNumber",
                sort : false
            }, {
                name : "创建用户",
                field : "createUserName",
                sort : false
            } ],
			data : {
				type : 'URL',
				value : getServer()
                + '/flea/hclv/visitor/visitorPay/getRebackRecoderByOrder.htmls?orderNo=' + this.entity.orderNo
			}
		})
	};
	return rebackRecodeSupportInit;
});